<h2>Quản lý sản phẩm</h2>


<h2><a href="<?php echo $this->baseUrl('/admin/product-create/'); ?>">Nhập sản phẩm mới</a></h2>


<form action="<?= $this->baseUrl('/admin/product/') ?>" name="frmSmall" id="frmSmall" method="get" class="frmSmall">
	<p>
		<label class="required" for="cat_id">Danh mục:</label> 
		<select id="cat_id" name="cat_id">
			<option label="Tất cả" value="">Tất cả</option>
		    <?php foreach($this->categories as $category ) : ?>
		    <option <?php if($this->catID == $category['cat_id']) echo 'selected="selected"';?> label="<?php echo $category['cat_name'] ?>" value="<?php echo $category['cat_id'] ?>"><?php echo $category['cat_name'] ?></option>
		    <?php endforeach;?>
		</select>
	</p>
	<p>
		<label class="required" for="dim_id">Tỉ lệ:</label> 
		<select id="dim_id" name="dim_id">
			<option label="Tất cả" value="">Tất cả</option>
			<?php foreach($this->dimensions as $dimension ) : ?>
		    <option <?php if($this->dimID == $dimension['dim_id']) echo 'selected="selected"';?> label="<?php echo $dimension['dim_value'] ?>" value="<?php echo $dimension['dim_id'] ?>"><?php echo $dimension['dim_value'] ?></option>
		    <?php endforeach;?>
		</select>
	</p>
	<p class="btn">
		<input type="submit" value="Tìm kiếm" id="submit" name="submit">
	</p>
</form>

<div class="parameters">
    <table cellspacing="0" cellpadding="0" class="tbLarger">
        <tr>
            <th>Mã sản phẩm</th>  
			<th width="550">Tên sản phẩm</th>  
			<th width="100">&nbsp;</th>
        </tr>  
        <?php foreach($this->paginator as $key => $product) { ?>
	    <tr <?php if( $key % 2 == 1 ) echo 'class="highlight"'; ?>>
			<td><?php echo $product->product_id; ?></td>
			<td><?php echo $product->name; ?></td>
			<td><a href="<?php echo $this->baseUrl('/admin/product-update/product_id/'.$product->product_id); ?>">Sửa</a> | 
				<a href="<?php echo $this->baseUrl('/admin/product-delete/product_id/'.$product->product_id); ?>" onclick="return confirm('Bạn có thật sự muốn xóa hay không ?');">Xóa</a>
				</td>
		</tr>
	    <?php } ?>
    </table>
    <?php
		echo $this->paginationControl($this->paginator, 'Sliding', 'partials/_pagination-control.phtml');
	?>
</div>
        